// Andy object class which want to be rendered should inherited from this base object.
#pragma once
#include "Line.h"

class Material;
class RenderableObject;
class Triangle;
struct IntersectInfo 
{
    RenderableObject* pObject;
    Vector3f          fPoint;       // Intersect point
    Vector3f          vNormal;
    float             fDistance; 
    Material*         pMaterial;
    Triangle*         pTriangle;
};

class RenderableObject
{
protected:
	unsigned int _id;
public:
    RenderableObject(void);
    virtual ~RenderableObject(void);

	void SetID(unsigned int id)
	{
		_id = id;
	}
	unsigned int GetID()
	{
		return _id;
	}


    // Must implement this methold.
    // @line:     the incident line.
    // @fDisance: Set the distance from intersect point from the source point of the light.
    // @return  : if intersect return true.
    virtual bool Intersect(Line* line, IntersectInfo *pInfo) = 0;
};
